package com.nlp.cahe;

import java.util.List;
import java.util.concurrent.locks.ReentrantLock;

import io.lettuce.core.RedisClient;
import io.lettuce.core.sentinel.api.StatefulRedisSentinelConnection;
public class Test{
	
	public static void main(String[] args) {
		
		RedisClient client = RedisClient.create();
		StatefulRedisSentinelConnection<String, String> connectSentinel = client.connectSentinel();
		
		/*io.lettuce.core.ClientOptions.Builder
		io.lettuce.core.resource.ClientResources resources = new io.lettuce.core.resource.DefaultClientResources();
		io.lettuce.core.RedisClient client = io.lettuce.core.RedisClient.create()*/
		/*RedisClient client = RedisClient.create();
		StatefulRedisSentinelConnection c = client.connectSentinel();*/
		
		ReentrantLock lock = new ReentrantLock(true);
		lock.lock();
		int[] data = {95,94,91,98,99,90,99,93,91,92};
		int min = data[0];
		int max = data[0];
		for (int i = 0; i < data.length; i++) {
			if (min > data[i]) {
				min = data[i];
			}
			if (max < data[i]) {
				max = data[i];
			}
		}
		System.out.println("最小的数："+min);
		System.out.println("最大的数："+max);
		int lenght = max-min+1;
		int[] sort = new int[lenght];
		for (int i = 0; i < data.length; i++) {
			sort[data[i]-min] =data[i];
		}
		
		for (int i = 0; i < sort.length; i++) {
			if (sort[i] > 0) {
				System.out.print(sort[i]+"\t");
			}
		}

		
		
		
		
	}
	
}
